package pers.leeyns.rd.utils;

public class StringUtils {
	
	/**
	 * 把英文字符串的首字母大写,其余字母都小写
	 * @param String
	 * @return
	 */
	public static String getFirstCharToUpper(String str){
		if(!str.matches("\\w+")){
			throw new IllegalArgumentException("Arguments is not english string:"+str);
		}
		else if(isNullOrEmpty(str)){
			throw new IllegalArgumentException("Arguments error string:"+str);
		}
		else{
			return String.valueOf(str.charAt(0)).toUpperCase() + str.substring(1, str.length()).toLowerCase();
		}
		
	}
	
	public static boolean isNullOrEmpty(String str){
		return str == null || str.length() == 0;
	}
	
	public static void main(String[] args) {
		String str = getFirstCharToUpper("lkadSfg");
		System.out.println(str);
	}
}
